package com.cell.foodie.back.goods.service;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cell.foodie.back.goods.dao.GoodsMapper;
import com.cell.foodie.back.goods.entity.Goods;



@Service
public class GoodsServiceImpl implements GoodsService{

	@Autowired
	GoodsMapper goodsMapper;
	

	@Override
	public List<Goods> getGoods(Goods goods) {
		return goodsMapper.getGoods(goods);	
	}
	/**
	 * 查询
	 */
	@Override
	public List<Goods> getGoodss(Goods goods) {
		List<Goods> goodsList = goodsMapper.getGoodss(goods);
		return goodsList;
	}
	
	/**
	 * 添加
	 */
	@Override
	public void add(Goods goods) {
		goods.setId(UUID.randomUUID().toString().replaceAll("-", ""));
		goodsMapper.add(goods);
	}

}
